package com.wn.common.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;
import java.util.Date;


@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "方案表")
public class Scheme {
    @ApiModelProperty(value = "旅行路线id",example = "1")
    private Integer id;

    @ApiModelProperty(value = "旅行方案名",example = "丝绸之路")
//    @Pattern(regexp = "^[\\u4e00-\\u9fa5]+$",message ="景点名称格式错误")
    @NotBlank(message = "方案名不能为空")
    private String schemeName;

    @ApiModelProperty(value = "途径地的集合",example = "武汉、甘肃、蒙古、西藏")
    private String waytocity;

    @ApiModelProperty(value = "关联的旅行团id",hidden = true,example = "1")
    private Integer travelId;

    @ApiModelProperty(value = "客服电话",example = "13512341234")
    @Pattern(regexp = "^1[345678][0-9]{9}$",message = "客服电话格式错误！")
    private String phone;

    @ApiModelProperty(value = "订单价格",example = "7888")
    @NotNull(message = "价格不能为空！")
    private BigDecimal price;

    @ApiModelProperty(value = "风景图片")
    private String img;

    @ApiModelProperty(hidden = true)
    private Date createTime;

    @ApiModelProperty(hidden = true)
    private Date updateTime;

    @ApiModelProperty(hidden = true)
    private Integer isdeleted;

    @ApiModelProperty(value = "该旅线状态，0--正常，1--失效",example = "0")
    private String status;

    @ApiModelProperty(value = "路线描述详情（富文本框）",example = "<img src='#'/><h3>富文本框<h3>")
    private String richText;

    @ApiModelProperty(value = "旅行社",example = "")
    private String travelName;

    @NotBlank(message = "方案简介不能为空")
    private String synopsis;

    public Scheme(@NotBlank(message = "方案名不能为空") String schemeName, @NotNull(message = "价格不能为空！") BigDecimal price) {
        this.schemeName = schemeName;
        this.price = price;
    }
}
